﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DotSpatial.Controls;
using DotSpatial.Controls.Header;
using DotSpatial.Data;
using DotSpatial.Projections;
using HydroDesktop.Common;
using HydroDesktop.Common.Tools;
using HydroDesktop.Interfaces.ObjectModel;
using HydroDesktop.Interfaces.PluginContracts;
using HydroDesktop.WebServices;
using Search3xls.Area;
using Search3xls.Keywords;
using Search3xls.Properties;
using Search3xls.Searching;
using Search3xls.Searching.Exceptions;
using Search3xls.Settings;
using Search3xls.Settings.UI;
using Msg = Search3xls.MessageStrings;
using DotSpatial.Topology;
using DotSpatial.Symbology;
using Search3xls;
using System.IO;


namespace test_Searcj3xls
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            //Search3xls.MessageStrings p = new Search3xls.MessageStrings();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            label1.Text = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string keyword = "Water depth, stream";
            //When?
            //-----------------------------------------------------
            DateTime startDate = DateTime.Today;
            DateTime nDaysAgo = DateTime.Today.AddDays(-365 * 5);
            DateTime finishDate = nDaysAgo;

            //Where?
            //------------------------------------------------------
            double x1 = -12601641.49;
            double y1 = 4948244.62;
            double x2 = -12417745.49;
            double y2 = 5121231.28;

            Extent ext = new Extent(x1, y1, x2, y2);
            ProjectionInfo myProjection = new ProjectionInfo();
            ProjectionInfo target = KnownCoordinateSystems.Projected.World.WebMercator;
           // myProjection = KnownCoordinateSystems.Geographic.World.WGS1984;

            HydroDesktopSearch x = new HydroDesktopSearch(startDate, finishDate, keyword, ext, target); 

        }

        private void button2_Click(object sender, EventArgs e)
        {
            SynonymCtl Synonym = new SynonymCtl();
            textBox1.Text =  Synonym.getKeywordXml();
            textBox1.Refresh(); 
        }
    }
}
